/*
   @Copyright:LeetCode
   @Author:   tjyemail
   @Problem:  http://leetcode.com/problems/permutations
   @Language: C++
   @Datetime: 19-06-19 14:32
   */

// Method 1, std
class Solution {
public:
	vector<vector<int> > permute(vector<int>& nums) {
		vector<vector<int> > vs;
		sort(nums.begin(),nums.end());
		do{
			vs.push_back(nums);
		}while(next_permutation(nums.begin(),nums.end()));
		return vs;
	}
};
